<template>
  <div></div>
</template>

<script>
export default {
  data() {
    return {};
  },
  activated() {
    this.getCPSLink();
  },
  methods: {
    getCPSLink() {
      if(!this.$route.query.activ) return this.$dialog.alert({ message: '缺少重要参数' });
      $http.get("plugin.union-cps.api.shop.generate-link",{activity_id: this.$route.query.activ},'.').then((response) => {
        if (response.result == 1) {
          window.location.href = response.data.link;
        }else {
          this.$dialog.alert({ message: response.msg });
        }
      });
    },
  },
};
</script>

<style lang="scss" rel="stylesheet/scss" scoped></style>